package com.fl.anno3d.util;

import lombok.experimental.UtilityClass;

@UtilityClass
public class WktUtil {
    /**
     * 根据点坐标生成KWT格式字符串
     * @param leftDownX
     * @param leftDownY
     * @param rightUpX
     * @param rightUpY
     * @return
     */
    public String buildPolygon(String leftDownX,String leftDownY,String rightUpX,String rightUpY){
        String leftUpX = leftDownX;
        String leftUpY = rightUpY;
        String rightDownX = rightUpX;
        String rightDownY = leftDownY;
        String wkt = "POLYGON(("
                + leftDownX + " " + leftDownY +","
                + leftUpX + " " + leftUpY + ","
                + rightUpX + " " + rightUpY + ","
                + rightDownX + " " + rightDownY + ","
                + leftDownX + " " + leftDownY
                + "))";
        return wkt;

    }
}
